﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateUser.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="ManageBanking.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	  
   <link href="../../Content/css/account.css" rel="stylesheet" type="text/css" />
     
    <script src="../../Scripts/JTPS.js" type="text/javascript"></script>

    <link href="../../Content/css/jTPS.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">

        $(document).ready(function() {

            $('#gradient-style').jTPS({ perPages: [1,5, 12, 15, 50, 'ALL'], scrollStep: 1, scrollDelay: 30,
                clickCallback: function() {
                    // target table selector
                    var table = '#gradient-style';
                    // store pagination + sort in cookie 
                    document.cookie = 'jTPS=sortasc:' + $(table + ' .sortableHeader').index($(table + ' .sortAsc')) + ',' +
                                                'sortdesc:' + $(table + ' .sortableHeader').index($(table + ' .sortDesc')) + ',' +
                                                'page:' + $(table + ' .pageSelector').index($(table + ' .hilightPageSelector')) + ';';
                }
            });

            // reinstate sort and pagination if cookie exists
            var cookies = document.cookie.split(';');
            for (var ci = 0, cie = cookies.length; ci < cie; ci++) {
                var cookie = cookies[ci].split('=');
                if (cookie[0] == 'jTPS') {
                    var commands = cookie[1].split(',');
                    for (var cm = 0, cme = commands.length; cm < cme; cm++) {
                        var command = commands[cm].split(':');
                        if (command[0] == 'sortasc' && parseInt(command[1]) >= 0) {
                            $('#gradient-style .sortableHeader:eq(' + parseInt(command[1]) + ')').click();
                        } else if (command[0] == 'sortdesc' && parseInt(command[1]) >= 0) {
                            $('#gradient-style .sortableHeader:eq(' + parseInt(command[1]) + ')').click().click();
                        } else if (command[0] == 'page' && parseInt(command[1]) >= 0) {
                            $('#gradient-style .pageSelector:eq(' + parseInt(command[1]) + ')').click();
                        }
                    }
                }
            }

            // bind mouseover for each tbody row and change cell (td) hover style
            $('#gradient-style tbody tr:not(.stubCell)').bind('mouseover mouseout',
                                function(e) {
                                    // hilight the row
                                    e.type == 'mouseover' ? $(this).children('td').addClass('hilightRow') : $(this).children('td').removeClass('hilightRow');
                                }
                        );

        });


        </script>
    <style type="text/css">
        .style1
        {
            width: 110px;
        }
        .style2
        {
            width: 140px;
        }
    </style>
</asp:Content>
    

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
   <form id="form1" runat="server">
<%         
        List<decimal> money = (List<decimal>)ViewData["money"];
        List<InformationAccount> ac = (List<InformationAccount>)ViewData["info"];
        
        
         %>
    <div class="spotlighted">
        <div class="bchead">New Acc</div>
        <table id="gradient-style" summary="Meeting Results">
            <thead>
    	        <tr>
        	        <th align="center" sort="index" scope="col">Number Account</th>
        	        <th align="center" sort="description" scope="col">Name Account</th>
                    
                    <th align="center" sort="date" scope="col" class="style1">Creation Date</th>
                    <th align="center" sort="total" scope="col" class="style2">Balance</th>
                    <th align="center" sort="description" scope="col">Action</th>
                </tr>
            </thead>
            <tfoot class="nav">
                <tr>
                        <td class="foot" colspan=5>
                                <div class="pagination"></div>
                                <div class="paginationTitle">Page</div>
                                <div class="selectPerPage"></div>
                                <div class="status"></div>
                        </td>
                </tr>
        </tfoot>
            <tbody>
                <%for (int i = 0; i < ac.Count; i++)
                  { %>
                <tr>
                        <td align="center"><%=ac[i].IdAccount %></td>
                        <td align="center"><%=ac[i].Name %></td>
                        <td align="center"><%=ac[i].DateCreate %></td>
                        <td align="center"><%=money[i] %></td>
                        
                        <td align="center"><a href='<%=Url.Action("TransferMoney/"+ac[i].IdAccount+"/"+money[i],"T_Account") %>' >New Acc </a> &nbsp; 
                        </td>
                        
                </tr>

                
                
                <%} %>
                
        </tbody>
            
        </table>
    </div>

    </form>

</asp:Content>
